
#ifndef	ZIG_X_URL_HPP
#define	ZIG_X_URL_HPP

#include	<string>

namespace	zig
{

	class	URL
	{

	public	:
		URL( const std::string& url );
	
	public	:
		const char* url(void)      const { return m_url.c_str(); }

		const char* protocol(void) const { return m_protocol.c_str(); }
		const char* hostname(void) const { return m_hostname.c_str(); }
		int         port(void)     const { return m_port; }
		const char* path(void)     const { return m_path.c_str(); }
		const char* query(void)    const { return m_query.c_str(); }
		const char* anchor(void)   const { return m_anchor.c_str(); }

	private	:
		void	parse( const std::string& url );

		std::string	m_url;

		std::string	m_protocol;
		std::string	m_hostname;
		int			m_port;
		std::string	m_path;
		std::string	m_query;
		std::string	m_anchor;
	};	// class URL

}	// namespace zig

#endif	// ZIG_X_URL_HPP

